#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0;
  int k;
  cin >> k;
  for (int i = 1;; i++) {
    sum += i;
    if (sum == k) {
      cout << i - 1 << " " << 0;
      break;
    } else if (sum > k) {
      int no = k - (sum - i);
      int he = i - 1;
      cout << no - 1 << " " << he - (no - 1) << endl;
      break;
    }
  }

  return 0;
}
